import json
from config import BASE_DIR


# 定义工具函数,读取json文件的数据,转换成[(),(),()]格式的数据
def read_json_data(filename):
    with open(filename,"r",encoding="utf-8")as f:
        json_data = json.load(f)
        login_list = []
        for data in json_data:
            data.pop("desc")
            login_list.append(tuple(data.values()))
    return login_list

if __name__ == '__main__':
    filename = BASE_DIR + "/data/login_data.json"
    data = read_json_data(filename)
    print(data)